﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Xml;
using System.IO;
namespace WebServices
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface WebService
    {

        // Call Like: http://meshplace.com/mesh/svhost/Service1.svc/GetCategories
        [WebGet(ResponseFormat = WebMessageFormat.Xml, UriTemplate = "GetCategories")]
        [OperationContract, XmlSerializerFormat]
        XmlDocument GetCategories();

        // Call like: http://meshplace.com/mesh/svhost/Service1.svc/GetUserInfoByUID?uid=LMiller
        [WebGet(ResponseFormat = WebMessageFormat.Xml, UriTemplate = "GetUserInfoByUID?uid={uid}")]
        [OperationContract, XmlSerializerFormat]
        XmlDocument GetUserInfoByUID(string uid);

        /*
        // Call like: http://meshplace.com/mesh/svhost/Service1.svc/GetUserPostByCat?categoryType=Restaurant
        [WebGet(ResponseFormat = WebMessageFormat.Xml, UriTemplate = "GetUserPostByCat?categoryType={categoryType}")]
        [OperationContract, XmlSerializerFormat]
        XmlDocument GetUserPostByCat(string categoryType);*/

        // Call like: http://meshplace.com/mesh/svhost/Service1.svc/GetUserPostByZip?zip=16801
        [WebGet(ResponseFormat = WebMessageFormat.Xml, UriTemplate = "GetUserPostByZip?zip={zip}")]
        [OperationContract, XmlSerializerFormat]
        XmlDocument GetUserPostByZip(string zip);

        /* Since I didn't get any response to a request for services to strike,
         * I'm just going to start striking them and see if anyone complains.
         * This is the first service to be removed.
        // Call like: http://meshplace.com/mesh/svhost/Service1.svc/GetUserPostsByLName?lastName=Gawel
        [WebGet(ResponseFormat = WebMessageFormat.Xml, UriTemplate = "GetUserPostsByLName?lastName={lastName}")]
        [OperationContract, XmlSerializerFormat]
        XmlDocument GetUserPostsByLName(string lastName);
        */

        // Call like: http://meshplace.com/mesh/svhost/Service1.svc/CreateAccount
        // Expect parameters to be in POST format. GET calls will be refused.
        [WebInvoke(Method="POST")]
        [OperationContract, XmlSerializerFormat]
        XmlDocument CreateAccount(Stream data);

        // Call like: http://meshplace.com/mesh/svchost/Service1.svc/MakePost
        // Expect parameters to be in POST format. GET calls will be refused.
        [WebInvoke(Method = "POST")]
        [OperationContract, XmlSerializerFormat]
        XmlDocument MakePost(Stream data);

        // Call like: http://meshplace.com/mesh/svchost/Service1.svc/Login
        // Expect parameters to be in POST format. GET calls will be refused.
        [WebInvoke(Method = "POST")]
        [OperationContract, XmlSerializerFormat]
        XmlDocument Login(Stream data);

        // Call like: http://meshplace.com/mesh/svchost/Service1.svc/MakeComment
        // Expect parameters to be in POST format. GET calls will be refused.
        [WebInvoke(Method = "POST")]
        [OperationContract, XmlSerializerFormat]
        XmlDocument MakeComment(Stream data);

        // Call like: http://meshplace.com/mesh/svchost/Service1.svc/GetComments
        // Expect parameters to be in POST format. GET calls will be refused.
        [WebInvoke(Method = "POST")]
        [OperationContract, XmlSerializerFormat]
        XmlDocument GetComments(Stream data);

        // Call like: http://meshplace.com/mesh/svchost/Service1.svc/Logout
        // Expect parameters to be in POST format. GET calls will be refused.
        [WebInvoke(Method = "POST")]
        [OperationContract, XmlSerializerFormat]
        XmlDocument Logout(Stream data);

        // Call like: http://meshplace.com/mesh/svchost/Service1.svc/RatePost
        // Expect parameters to be in POST format. GET calls will be refused.
        [WebInvoke(Method = "POST")]
        [OperationContract, XmlSerializerFormat]
        XmlDocument RatePost(Stream data);

        // Call like: http://meshplace.com/mesh/svchost/Service1.svc/GetUserRatingForPost
        // Expect parameters to be in POST format. GET calls will be refused.
        [WebInvoke(Method = "POST")]
        [OperationContract, XmlSerializerFormat]
        XmlDocument GetUserRatingForPost(Stream data);

        // Run the web-services unit tests.
        // Call like: http://meshplace.com/mesh/svhost/Service1.svc/RunUnitTests
        [WebGet(ResponseFormat = WebMessageFormat.Xml, UriTemplate = "RunUnitTests")]
        [OperationContract, XmlSerializerFormat]
        XmlDocument RunUnitTests();

    }
}
